package arkanoid.components.ball;

import arkanoid.components.Palette;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.events.constants.Key;

public class AttachedBall extends BallState {

	@Override
	public void update(Ball ball, DeltaState deltaState) {
		Palette palette = ball.getScene().getPalette();
		ball.move(palette.getX() + palette.getWidth() / 2 - ball.getX(), 0);
		if (deltaState.isKeyPressed(Key.Z)) {
			ball.setState(new DisattachedNormalBall());
		}
	}

}
